package 适配器模式;

//适配器类
public class RectangleAdapter implements Shape{

    private LegacyRectangle legacyRectangle;

    public RectangleAdapter(LegacyRectangle legacyRectangle) {
        this.legacyRectangle = legacyRectangle;
    }

    @Override
    public void draw(int x, int y, int height, int weight) {
        int x1=x;
        int x2=y;
        int x3=x+weight;
        int x4=y+height;
        legacyRectangle.display(x1,x2,x3,x4);
    }
}
